package com.tedu.openmedical.medicalsystem.sysDict.controller;

import com.tedu.openmedical.base.response.JsonResult;
import com.tedu.openmedical.medicalsystem.sysDict.pojo.dto.DictQuery;
import com.tedu.openmedical.medicalsystem.sysDict.pojo.vo.SysDictDataVO;
import com.tedu.openmedical.medicalsystem.sysDict.service.SysDictDataService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/medical/medicalSystem/")
public class SysDictDataController {

    @Autowired
    private SysDictDataService sysDictDataService;

    @GetMapping("selectDictList")
    @ApiOperation(value = "查询字典数据", notes = "查询字典数据")
    public JsonResult selectDictList(DictQuery dictQuery) {
        log.debug("dictQuery: {}", dictQuery);
        List<SysDictDataVO> dictList = sysDictDataService.selectDictList(dictQuery);
        return JsonResult.ok(dictList);
    }
}
